
Partial Class HostForUserControl
    Inherits System.Web.UI.Page

    
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim rdr As New System.Xml.XmlTextReader("c:\OutputPart.wpc")
        Dim strMessage As String = ""
        Dim wp As WebPart
        Dim wpd As WebPartDescription
        Dim wpdc As WebPartDescriptionCollection
        Dim catdecl As DeclarativeCatalogPart
        Dim catimp As WebParts.ImportCatalogPart
        Dim catpage As WebParts.PageCatalogPart

      
        wpdc = Me.CatalogZone1.CatalogParts(0).GetAvailableWebPartDescriptions()
        Dim nwpd As New WebPartDescription("fred", "fred", Nothing, Nothing)

        Try
            wp = Me.CatalogZone1.CatalogParts(0).GetWebPart(nwpd)
        Catch ex As Exception
        End Try

        wp = Me.WebPartManager1.ImportWebPart(rdr, strMessage)
        rdr.Close()
        If strMessage Is Nothing Then
            wp.ID = "Search1"
            Me.WebPartManager1.AddWebPart(wp, Me.WebPartZone1, 0)
        End If

    End Sub
End Class
